package com.nbsaas.boot.wms.data.entity;

import com.nbsaas.boot.code.annotation.*;
import com.nbsaas.boot.jpa.data.entity.AbstractEntity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import org.hibernate.annotations.Comment;

@CreateByUser
@ComposeView
@Data
@FormAnnotation(title = "仓库区域", model = "仓库区域")
@Entity
@Table(name = "bs_warehouse_area")
@Comment("仓库区域表")
public class WarehouseArea extends AbstractEntity {

    @Comment("仓库ID")
    @FormField(title = "仓库ID", sortNum = "1", grid = true, required = true)
    private Long warehouseId;

    @Comment("区域编码")
    @SearchItem(name = "code", key = "code", label = "区域编码")
    @FormField(title = "区域编码", sortNum = "2", grid = true, required = true)
    @Column(length = 50, nullable = false)
    private String code;

    @Comment("区域名称")
    @SearchItem(name = "name", key = "name", label = "区域名称")
    @FormField(title = "区域名称", sortNum = "3", grid = true, required = true)
    @Column(length = 200, nullable = false)
    private String name;

    @Comment("区域类型")
    @FormField(title = "区域类型", sortNum = "4", grid = true, type = InputType.select)
    @Column(length = 20)
    private String type; // STORAGE-存储区, PICKING-拣货区, SHIPPING-发货区, RECEIVING-收货区

    @Comment("区域描述")
    @FormField(title = "区域描述", sortNum = "5", grid = true)
    @Column(length = 500)
    private String description;

    @Comment("区域状态")
    @FormField(title = "区域状态", sortNum = "6", grid = true, type = InputType.select)
    @Column(length = 20)
    private String status; // ACTIVE-启用, INACTIVE-停用

    @Comment("排序")
    @FormField(title = "排序", sortNum = "7", grid = true, type = InputType.el_input_number, sort = true)
    private Integer sort;

    @Comment("备注")
    @FormField(title = "备注", sortNum = "8", type = InputType.richText, col = 23)
    @Column(length = 1000)
    private String note;
} 